package com.example.shop_2208.mvvmdemo

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.example.shop_2208.entity.ParamLogin
import com.example.shop_2208.entity.UserEntityResult

class LoginViewModel:ViewModel() {
    val loginSuccess = MutableLiveData<UserEntityResult>()
    val loginFail = MutableLiveData<String>()
    val repo = LoginRepo()
    fun login(username:String,password:String){
        val param = ParamLogin(username, password)
      /*  val map = mutableMapOf<String,Any>()
        map["username"] = "abc"*/
        repo.login(param,loginSuccess,loginFail)
    }
}